package company.beike;

import java.util.Scanner;

public class BeiKe4 {

    static void primeNumber() {
        Scanner in = new Scanner(System.in);
        int m = in.nextInt(), n = in.nextInt();

        int p = 0, q = Math.abs((m - n)) + 1;
        for (int i = m; i <= n; i++) {
            if (isPrimeNumber(i)) {
                p++;
            }
        }
        int max = 1;
        for (int i = 2; i < p; i++) {
            if (p % i == 0 && q % i == 0) {
                max = i;
            }
        }
        System.out.printf("%d %d", p / max, q / max);
    }

    static boolean isPrimeNumber(int num) {
        double sqrtNum = Math.sqrt(num);
        for (int i = 2; i < sqrtNum; i++) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }
}
